<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>订单管理</title>
    <link rel="stylesheet" href="css/base.css" />
    <link rel="stylesheet" href="css/all.css" />
    <link rel="stylesheet" href="css/iconfont.css" />
    <link rel="stylesheet" href="css/order-completed.css" />
</head>
<body>
<div>
    <div class="head">
         <span onclick="location.href='./order-income.html'">
        <i class="iconfont icon-iconfontjiantou1"></i></span>
        <h1 class="titles">订单管理</h1>
    </div>
    <div class="middles">
        <div class="finish">
            <ul class="row">
                <li onclick="location.href='./order-send-goods.html'" class="send">
                    <span>待发货</span>
                </li>
                <li onclick="location.href='./order-delivered.html'" class="sends">
                    <span>已发货</span>
                </li>
                <li onclick="location.href='./order-completed.html'" class="send">
                    <span>已完成</span>
                </li>
                <li onclick="location.href='./order-refund.html'" class="send">
                    <span>退款/售后</span>
                </li>
            </ul>
        </div>

        <div id="supplierOrder">

        </div>
        <!--<div class="merch">
            <div onclick="location.href='./delivered.html'" class="brief row">
                <div class="picture">
                    <img src="img/pin.png" alt="">
                </div>
                <div class="essay">
                    <p>
                        女童洋气套装2018新款春秋装儿童时尚运动金丝绒两件套小孩小孩卫衣装
                    </p>
                </div>
                <div class="price">
                    <strong>
                        ￥59.9
                    </strong>
                </div>
            </div>
            <div class="total">
                <p>共一件商品  合计：￥29.50</p>
            </div>
            <div class="performs">
                <div onclick="location.href='./delivered.html'" class="perform">
                    <p>已发货</p>
                </div>
            </div>
        </div>
        <div class="merch">
            <div onclick="location.href='./delivered.html'" class="brief row">
                <div class="picture">
                    <img src="img/pin.png" alt="">
                </div>
                <div class="essay">
                    <p>
                        女童洋气套装2018新款春秋装儿童时尚运动金丝绒两件套小孩小孩卫衣装
                    </p>
                </div>
                <div class="price">
                    <strong>
                        ￥59.9
                    </strong>
                </div>
            </div>
            <div class="total">
                <p>共一件商品  合计：￥29.50</p>
            </div>
            <div class="performs">
                <div onclick="location.href='./delivered.html'" class="perform">
                    <p>已发货</p>
                </div>
            </div>
        </div>
        <div class="merch">
            <div onclick="location.href='./delivered.html'" class="brief row">
                <div class="picture">
                    <img src="img/pin.png" alt="">
                </div>
                <div class="essay">
                    <p>
                        女童洋气套装2018新款春秋装儿童时尚运动金丝绒两件套小孩小孩卫衣装
                    </p>
                </div>
                <div class="price">
                    <strong>
                        ￥59.9
                    </strong>
                </div>
            </div>
            <div class="total">
                <p>共一件商品  合计：￥29.50</p>
            </div>
            <div class="performs">
                <div onclick="location.href='./delivered.html'" class="perform">
                    <p>已发货</p>
                </div>
            </div>
        </div>-->
    </div>
</div>
<script src="js/x_rem.js"></script>
<script src="./js/jquery-1.10.2.js"></script>
<script src="js/all.js"></script>

<script>
    $(function() {
        var data = JSON.stringify({
            "index": 0,
            "size": 10,
            "status": 2//0 待付款 1待发货 2待收货 3 待评价 4售后 5已售罄 6订单取消
        });
        var succrss = (data) => {
            console.log(data.message.code);
            if(data.message.code == 200) {
                var html = "";
                if(data.data != null&& data.data.orderList != null){
                    for(let i = 0; i<data.data.orderList.length; i++) {
                        html += `<div class="merch">
                                    <div onclick="location.href='./delivered.html?orderId=${data.data.orderList[i].orderId}'" class="brief row">
                                        <div class="picture">
                                            <img src="${data.data.orderList[i].picture}" alt="">
                                        </div>
                                        <div class="essay">
                                            <p>
                                                 ${data.data.orderList[i].title}
                                            </p>
                                        </div>
                                        <div class="price">
                                            <strong>
                                                ￥${data.data.orderList[i].price}
                                            </strong>
                                        </div>
                                    </div>
                                    <div class="total">
                                        <p> 合计：￥${data.data.orderList[i].totalPrice}</p>
                                    </div>
    		  				`
                    }
                    $("#supplierOrder").html(html);
                }

            } else {
                popup(data.message.msg);
            }
        };

        Hajax("post", "/supplier/order/getOrderList", data, succrss);
    });
</script>
</body>
</html>